package com.nsgf.library.data.bean;

import androidx.databinding.BaseObservable;
import androidx.databinding.Bindable;

import com.nsgf.library.BR;
import com.nsgf.library.widget.prckerview.OptionsPickerView;
import com.nsgf.library.widget.prckerview.model.IPickerViewData;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

public class MonitorBean {

    private String monitorCode;
    private MoMonitorDataBean moMonitorData;
    private List<SectionBean> section;
    private List<TestNumBean> testNum;
    private List<FilesBean> files;

    public String getMonitorCode() {
        return monitorCode;
    }

    public void setMonitorCode(String monitorCode) {
        this.monitorCode = monitorCode;
    }

    public MoMonitorDataBean getMoMonitorData() {
        if (null == moMonitorData)
            moMonitorData = new MoMonitorDataBean();
        return moMonitorData;
    }

    public void setMoMonitorData(MoMonitorDataBean moMonitorData) {
        this.moMonitorData = moMonitorData;
    }

    public List<SectionBean> getSection() {
        if (null == section)
            section = new ArrayList<>();
        return section;
    }

    public void setSection(List<SectionBean> section) {
        this.section = section;
    }

    public List<TestNumBean> getTestNum() {
        if (null == testNum)
            testNum = new ArrayList<>();
        return testNum;
    }

    public void setTestNum(List<TestNumBean> testNum) {
        this.testNum = testNum;
    }

    public List<FilesBean> getFiles() {
        if (null == files)
            files = new ArrayList<>();
        return files;
    }

    public String getFilesSrc() {
        if (null != getFiles()) {
            if (!getFiles().isEmpty())
                return getFiles().get(0).getFilePath();
            return "";
        } else
            return "";
    }

    public void setFiles(List<FilesBean> files) {
        this.files = files;
    }

    public static class MoMonitorDataBean {
        /**
         * id : 1871818307377684484
         * monitorCode : bxjc1861344125580873728
         * testNum : 测次2
         * time : 2025-01-14 00:00:00
         * testPoint : 断面1
         * displacementN : 1
         * verticalSectionName : null
         * projectCode : null
         * displacementE : 0.3
         * horizontalSectionName : null
         * displacement : null
         * isDelete : 0
         * createTime : 2025-01-13 15:20:36
         * sectionName : null
         */

        private String id;
        private String monitorCode;
        private String testNum;
        private String time;
        private String testPoint;
        private String displacementN;
        private Object verticalSectionName;
        private Object projectCode;
        private String displacementE;
        private Object horizontalSectionName;
        private Object displacement;
        private int isDelete;
        private String createTime;
        private Object sectionName;

        public String getId() {
            return id;
        }

        public void setId(String id) {
            this.id = id;
        }

        public String getMonitorCode() {
            return monitorCode;
        }

        public void setMonitorCode(String monitorCode) {
            this.monitorCode = monitorCode;
        }

        public String getTestNum() {
            return testNum;
        }

        public void setTestNum(String testNum) {
            this.testNum = testNum;
        }

        public String getTime() {
            return time;
        }

        public void setTime(String time) {
            this.time = time;
        }

        public String getTestPoint() {
            return testPoint;
        }

        public void setTestPoint(String testPoint) {
            this.testPoint = testPoint;
        }

        public String getDisplacementN() {
            return displacementN;
        }

        public void setDisplacementN(String displacementN) {
            this.displacementN = displacementN;
        }

        public Object getVerticalSectionName() {
            return verticalSectionName;
        }

        public void setVerticalSectionName(Object verticalSectionName) {
            this.verticalSectionName = verticalSectionName;
        }

        public Object getProjectCode() {
            return projectCode;
        }

        public void setProjectCode(Object projectCode) {
            this.projectCode = projectCode;
        }

        public String getDisplacementE() {
            return displacementE;
        }

        public void setDisplacementE(String displacementE) {
            this.displacementE = displacementE;
        }

        public Object getHorizontalSectionName() {
            return horizontalSectionName;
        }

        public void setHorizontalSectionName(Object horizontalSectionName) {
            this.horizontalSectionName = horizontalSectionName;
        }

        public Object getDisplacement() {
            return displacement;
        }

        public void setDisplacement(Object displacement) {
            this.displacement = displacement;
        }

        public int getIsDelete() {
            return isDelete;
        }

        public void setIsDelete(int isDelete) {
            this.isDelete = isDelete;
        }

        public String getCreateTime() {
            return createTime;
        }

        public void setCreateTime(String createTime) {
            this.createTime = createTime;
        }

        public Object getSectionName() {
            return sectionName;
        }

        public void setSectionName(Object sectionName) {
            this.sectionName = sectionName;
        }
    }

    public static class SectionBean implements IPickerViewData {
        /**
         * sectionName : 横断面
         * type : 0
         */

        private String sectionName;
        private int type;

        public String getSectionName() {
            return sectionName;
        }

        public void setSectionName(String sectionName) {
            this.sectionName = sectionName;
        }

        public int getType() {
            return type;
        }

        public void setType(int type) {
            this.type = type;
        }

        @Override
        public String getPickerViewText() {
            return getSectionName();
        }
    }

    public static class TestNumBean extends BaseObservable implements IPickerViewData, Serializable {
        /**
         * testNum : 测次2
         * createTime : 2025-01-13T15:20:36
         */

        private String testNum;
        private String createTime;
        private boolean check;

        public String getTestNum() {
            return testNum;
        }

        public void setTestNum(String testNum) {
            this.testNum = testNum;
        }

        public String getCreateTime() {
            return createTime;
        }

        public void setCreateTime(String createTime) {
            this.createTime = createTime;
        }

        @Override
        public String getPickerViewText() {
            return getTestNum();
        }

        @Bindable
        public boolean isCheck() {
            return !check;
        }

        public void setCheck(boolean check) {
            this.check = check;
            notifyPropertyChanged(BR.check);
        }
    }

    public static class FilesBean {
        /**
         * fileName : null
         * filePath : /monitor/jpeg格式图片.jpeg
         * fileSize : 0
         * isDelete : null
         */

        private Object fileName;
        private String filePath;
        private int fileSize;
        private Object isDelete;

        public Object getFileName() {
            return fileName;
        }

        public void setFileName(Object fileName) {
            this.fileName = fileName;
        }

        public String getFilePath() {
            return filePath;
        }

        public void setFilePath(String filePath) {
            this.filePath = filePath;
        }

        public int getFileSize() {
            return fileSize;
        }

        public void setFileSize(int fileSize) {
            this.fileSize = fileSize;
        }

        public Object getIsDelete() {
            return isDelete;
        }

        public void setIsDelete(Object isDelete) {
            this.isDelete = isDelete;
        }
    }
}
